﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MS_UI
{
    public partial class FrmParaModify : Form
    {
        public FrmParaModify()
        {
            InitializeComponent();
        }
        int ModifyAddress = 0;

        public FrmParaModify(string InitialValue,string Address)
        {
            this.lbl_Initial.Text = InitialValue;
            ModifyAddress = Convert.ToInt32(Address);
        }

        private void btn_Cannel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btn_Sure_Click(object sender, EventArgs e)
        {
            CommonMethod.IsWriting = true;
            Thread.Sleep(500);
            if (CommonMethod.objMod.PreSetFloatKeepReg(CommonMethod.Address, ModifyAddress, float.Parse(this.txt_Modify.Text.Trim())))
            {
                MessageBox.Show("修改成功！","修改提示");
            }
            else
            {
                MessageBox.Show("修改失败！", "修改提示");
            }
            CommonMethod.IsWriting = false;
        }
    }
}
